capture log close
log using "B:\Col_Minimum_Wage\Code\Clean/clean_rr_PIBTotal.txt", replace text
/*==================================================
project:       Limpiar bases de PIB total por departamento para 1990-2005
Author:        Diego Mayorga Córdova 
E-email:       
url:           
Dependencies:  Banco de México
----------------------------------------------------
Creation Date:     4 Feb 2020 - 11:32:13
Modification Date:   
Do-file version:    01
References:          
Output:             
==================================================*/

/*==================================================
              0: Program set up
==================================================*/
version 15.1
drop _all

glo carpeta 	"B:\Col_Minimum_Wage"
glo codigo 		"$carpeta/Code"
glo data		"$carpeta/Data"
glo ster 		"$carpeta/Ster"

/*==================================================
              1: 
==================================================*/
use "$data/Importable/PIBdept/PIBdept.dta" , clear

/*==================================================
              2: 
==================================================*/
drop in 1/8
drop in 2
drop in 26/28
drop in 35
drop in 36/137
drop in 1
rename A departamento

loc c = 1990
foreach var of varlist B-Q{
	rename `var' y`c'
	destring y`c' , replace
	loc ++c
}
/*==================================================
              3: reshape
==================================================*/
reshape long y, i(departamento)  j(año)
rename y pib

/*==================================================
              4: 
==================================================*/

gen area = .
	replace area = 8  if departamento == "Atlántico"
	replace area = 11 if departamento == "Cundinamarca"
	replace area = 68 if departamento == "Santander"
	replace area = 76 if departamento == "Valle"
	replace area = 17 if departamento == "Caldas"
	replace area = 5  if departamento == "Antioquia"
	replace area = 52 if departamento == "Nariño"
drop if area == .
rename año year

tsset year area
gen rez_pib = pib[_n-1]
/*==================================================
              5: 
==================================================*/
save "$data/Clean/PIBdept/PIBdept.dta", replace




log close
exit
/* End of do-file */

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

Notes:
1.
2.
3.


Version Control:


